<html>
<head>
  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1">
  <title>Contents.m</title>
<link rel="stylesheet" type="text/css" href="../stpr.css">
</head>
<body>
<table  border=0 width="100%" cellpadding=0 cellspacing=0><tr valign="baseline">
<td valign="baseline" class="function"><b class="function">CLIPLINE</b>
<td valign="baseline" align="right" class="function"><a href="../visual/index.html" target="mdsdir"><img border = 0 src="../up.gif"></a></table>
  <p><b>clips line into given window.</b></p>
  <hr>
<div class='code'><code>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Synopsis:</span></span><br>
<span class=help>&nbsp;&nbsp;[x1,y1,x2,y2,inside]&nbsp;=&nbsp;clipline(W,b,window)</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Description:</span></span><br>
<span class=help>&nbsp;&nbsp;This&nbsp;function&nbsp;returns&nbsp;2d&nbsp;points&nbsp;(x1,y1)&nbsp;and&nbsp;(x2,y2)&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;of&nbsp;a&nbsp;line&nbsp;segment&nbsp;given&nbsp;by&nbsp;line</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;W'*x&nbsp;+&nbsp;b&nbsp;=&nbsp;0</span><br>
<span class=help></span><br>
<span class=help>&nbsp;&nbsp;clipped&nbsp;to&nbsp;the&nbsp;given&nbsp;window.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Input:</span></span><br>
<span class=help>&nbsp;&nbsp;W&nbsp;[2x1]&nbsp;Normal&nbsp;of&nbsp;line.</span><br>
<span class=help>&nbsp;&nbsp;b&nbsp;[1x1]&nbsp;Line&nbsp;threshold.</span><br>
<span class=help>&nbsp;&nbsp;window&nbsp;[4x1]&nbsp;Contains&nbsp;[left&nbsp;right&nbsp;top&nbsp;bottom].</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Output:</span></span><br>
<span class=help>&nbsp;&nbsp;x1&nbsp;[1x1],&nbsp;y1&nbsp;[1x1]&nbsp;The&nbsp;first&nbsp;point&nbsp;of&nbsp;line&nbsp;segment.</span><br>
<span class=help>&nbsp;&nbsp;x2&nbsp;[1x1],&nbsp;y2&nbsp;[1x1]&nbsp;The&nbsp;second&nbsp;point&nbsp;of&nbsp;line&nbsp;segment.</span><br>
<span class=help>&nbsp;&nbsp;inside&nbsp;[1x1]&nbsp;1&nbsp;if&nbsp;line&nbsp;W'*x+b=0&nbsp;intersects&nbsp;the&nbsp;window.&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;</span><br>
<span class=help>&nbsp;<span class=help_field>Example:</span></span><br>
<span class=help>&nbsp;&nbsp;figure;&nbsp;hold&nbsp;on;</span><br>
<span class=help>&nbsp;&nbsp;axis([-1&nbsp;1&nbsp;-1&nbsp;1]);</span><br>
<span class=help>&nbsp;&nbsp;window&nbsp;=&nbsp;0.5*axis;</span><br>
<span class=help>&nbsp;&nbsp;[x1,y1,x2,y2]=clipline([-1;1],0,window);</span><br>
<span class=help>&nbsp;&nbsp;plot([x1&nbsp;x2],[y1&nbsp;y2]);</span><br>
<span class=help></span><br>
</code></div>
  <hr>
  <b>Source:</b> <a href= "../visual/list/clipline.html">clipline.m</a>
  <p><b class="info_field">About: </b>  Statistical Pattern Recognition Toolbox<br>
 (C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac<br>
 <a href="http://www.cvut.cz">Czech Technical University Prague</a><br>
 <a href="http://www.feld.cvut.cz">Faculty of Electrical Engineering</a><br>
 <a href="http://cmp.felk.cvut.cz">Center for Machine Perception</a><br>

  <p><b class="info_field">Modifications: </b> <br>
 30-apr-2004, VF<br>

</body>
</html>
